﻿using RpcSync.Model;
using RpcSync.Model.DB;
using SqlSugarHelper;

namespace RpcSync.DAL.Repository
{
    internal class RemoteServerTypeDAL : IRemoteServerTypeDAL
    {
        private IRepository<RemoteServerTypeModel> _BasicDAL;
        public RemoteServerTypeDAL(IRepository<RemoteServerTypeModel> dal)
        {
            _BasicDAL = dal;
        }
        public long GetSystemTypeId(string sysType)
        {
            return this._BasicDAL.Get(c => c.TypeVal == sysType, c => c.Id);
        }
        public SystemType[] GetSystemType()
        {
            return this._BasicDAL.GetAll(c => new SystemType
            {
                Id = c.Id,
                GroupId = c.GroupId,
                TypeVal = c.TypeVal
            });
        }
    }
}
